//   Copyright 2012,2013 Vaughn Vernon
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.

package com.saasovation.agilepm.domain.model.product.backlogitem;

import java.util.Date;

import com.saasovation.agilepm.domain.model.product.release.ReleaseId;
import com.saasovation.agilepm.domain.model.tenant.TenantId;
import com.saasovation.common.domain.model.DomainEvent;

/**
 * @领域事件：待定事项未预订
 */
public class BacklogItemUnscheduled implements DomainEvent {

    /**
     * 待办事项ID
     */
    private BacklogItemId backlogItemId;
    /**
     * 事件版本
     */
    private int eventVersion;
    /**
     * 发生日期
     */
    private Date occurredOn;
    /**
     * 租户ID
     */
    private TenantId tenantId;
    /**
     * 为发布ID未预订
     */
    private ReleaseId unscheduledForReleaseId;

    /**
     * 由以下参数构造待办事项未预订
     * @param aTenantId                 租户ID
     * @param aBacklogItemId            待办事项ID
     * @param anUnscheduledForReleaseId 未预定发布ID
     */
    public BacklogItemUnscheduled(TenantId aTenantId, BacklogItemId aBacklogItemId, ReleaseId anUnscheduledForReleaseId) {
        // 调用 父类默认构造器
        super();

        this.backlogItemId = aBacklogItemId;
        // 设置事件版本为1
        this.eventVersion = 1;
        this.occurredOn = new Date();
        this.tenantId = aTenantId;
        this.unscheduledForReleaseId = anUnscheduledForReleaseId;
    }

    /**
     * 获取待办事项ID
     * @return   返回待办事项ID
     */
    public BacklogItemId backlogItemId() {
        return this.backlogItemId;
    }

    /**
     * 获取事件版本
     * @return  返回事件版本
     */
    @Override
    public int eventVersion() {
        return this.eventVersion;
    }

    /**
     * 获取发生日期
     * @return  返回发生日期
     */
    @Override
    public Date occurredOn() {
        return this.occurredOn;
    }

    /**
     * 获取租户ID
     * @return  返回租户ID
     */
    public TenantId tenantId() {
        return this.tenantId;
    }

    /**
     * 获取未预订发布ID
     * @return  返回未预订发布ID
     */
    public ReleaseId unscheduledForReleaseId() {
        return this.unscheduledForReleaseId;
    }
}
